import request from '@/utils/request'


//获取课程列表
export function getCourseList(options){
  return request({
    url: 'mg/KeCourse/GetList',
    method: 'get',
    params:options
  })
}


/**
 * 获取课程信息
 * @param {*} options {id}
 */
export function getCourseInfo(options){
  return request({
    url: '/mg/KeCourse/GetDetails',
    method: 'get',
    params: options
  })
}

/**
 * 课程上下架
 * @param {*} options {id,isopen}
 */
export function setCourseOpenState(options){
  return request({
    url: '/mg/KeCourse/setOpenState',
    method: 'get',
    params: options
  })
}



/**
 * 获取课程评价列表
 * @param {*} options {page,rows,nickname,shopName}
 */
export function getCourseCommentList(options){
  return request({
    url: '/mg/KeCourse/GetCommentList',
    method: 'get',
    params: options
  })
}


/**
 * 获取课程评价详情
 * @param {*} options {id}
 */
export function getCommentInfo(options){
  return request({
    url: '/mg/KeCourse/GetCommentInfo',
    method: 'get',
    params: options
  })
}


/**
 * 删除课程评价
 * @param {*} options  {id}
 */
export function deleteComment(options){
  return request({
    url: '/mg/KeCourse/DeleteComment',
    method: 'get',
    params: options
  })
}

/**
 * 修改课程评价
 * @param {*} data  {id,comment}
 */
export function editComment(data){
  return request({
    url: '/mg/KeCourse/EditComment',
    method: 'post',
    data
  })
}
